package com.taorenqi.business.widget.menu;


import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.taorenqi.business.R;


public class MenuLinearLayoutFinal extends LinearLayout {

    private TextView menu_price;
    private View menu_line;
    private TextView menu_daozhang;
    private TextView menu_zhijie;
    private TextView menu_discount;
    private LinearLayout menu_body;
    private boolean isClick  = false;//false 没有点击 true 点击了
    private LabelView label;

    public MenuLinearLayoutFinal(Context context) {
        super(context);
    }

    public MenuLinearLayoutFinal(Context context, AttributeSet attrs) {
        super(context, attrs);

        LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        inflater.inflate(R.layout.bug_gb_menu_final,this);
        menu_body = (LinearLayout) findViewById(R.id.menu_body);
        menu_price = (TextView) findViewById(R.id.menu_price);
        menu_line = findViewById(R.id.menu_line);
        menu_daozhang = (TextView) findViewById(R.id.menu_daozhang);
        menu_zhijie = (TextView) findViewById(R.id.menu_zhijie);//只要设置颜色
        menu_discount = (TextView) findViewById(R.id.menu_discount);
    }



    /**
     * 设置整体的常规颜色
     * @param body 主体的背景颜色
     * @param price 价钱的颜色
     * @param line 中间那条线的颜色
     * @param discount 折扣的颜色
     * @param huode "获得"颜色的
     * @param gbnum GB的数量的颜色
     *
     */
    public void setNormalColor(int body,int price,int line,int discount,int huode,int gbnum){
        menu_body.setBackgroundResource(body);
        menu_price.setTextColor(price);
        menu_line.setBackgroundColor(line);
        menu_daozhang.setTextColor(discount);
        menu_zhijie.setTextColor(huode);
        menu_discount.setTextColor(gbnum);
    }

    /**
     * 设置整体的点击颜色
     * @param body 主体的背景颜色
     * @param price 价钱的颜色
     * @param line 中间那条线的颜色
     * @param discount 折扣的颜色
     * @param huode "获得"颜色的
     * @param gbnum GB的数量的颜色
     */
    public void setClickColor(int body,int price,int line,int discount,int huode,int gbnum){
        menu_body.setBackgroundResource(body);
        menu_price.setTextColor(price);
        menu_line.setBackgroundColor(line);
        menu_daozhang.setTextColor(discount);
        menu_zhijie.setTextColor(huode);
        menu_discount.setTextColor(gbnum);
    }


    public boolean isClick(){
        return isClick;
    }

    public void setClick(Boolean bol){
        isClick = bol;
    }

}
